home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Extras / MIDI / camd-37.1 / development / examples / camdlistreq / main.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-17  |  1.5 KB  |  58 lines

  1.  
  2. #include <exec/types.h>
  3. #include <exec/libraries.h>
  4. #include <clib/exec_protos.h>
  5. #include <pragmas/exec_pragmas.h>
  6. #include <stdlib.h>
  7.  
  8. #include "camdlists.h"
  9.  
  10. extern struct ExecBase *SysBase;
  11.  
  12. struct GfxBase  *GfxBase;
  13. struct Library  *IntuitionBase,
  14.                 *GadToolsBase,
  15.                 *UtilityBase,
  16.                 *CamdBase,
  17.                 *RealTimeBase;
  18.  
  19. void main(int argc, char *argv[])
  20. {   APTR    req;
  21.     LONG    result;
  22.     char    buffer[60] = "Initial String";
  23.  
  24.     GfxBase = (struct GfxBase *)OpenLibrary("graphics.library",36L);
  25.     if (GfxBase == NULL) goto bye;
  26.     IntuitionBase = OpenLibrary("intuition.library",36L);
  27.     if (IntuitionBase == NULL) goto bye;
  28.     GadToolsBase = OpenLibrary("gadtools.library",36L);
  29.     if (GadToolsBase == NULL) goto bye;
  30.     UtilityBase = OpenLibrary("utility.library",36L);
  31.     if (UtilityBase == NULL) goto bye;
  32.     CamdBase = OpenLibrary("camd.library",0L);
  33.     if (CamdBase == NULL) goto bye;
  34.     RealTimeBase = OpenLibrary("realtime.library",0L);
  35.     if (RealTimeBase == NULL) goto bye;
  36.  
  37.     if (req = AllocListRequest(TAG_END))
  38.     {
  39.         result = SelectConductor( req, buffer, sizeof buffer, TAG_END );
  40.         result = SelectCluster( req, buffer, sizeof buffer, TAG_END );
  41.  
  42.         FreeListRequest(req);
  43.     }
  44.  
  45. bye:
  46.     if (GfxBase)
  47.     {
  48.         CloseLibrary(RealTimeBase);
  49.         CloseLibrary(CamdBase);
  50.         CloseLibrary(UtilityBase);
  51.         CloseLibrary(GadToolsBase);
  52.         CloseLibrary(IntuitionBase);
  53.         CloseLibrary((struct Library *)GfxBase);
  54.     }
  55.  
  56.     exit(0);
  57. }
  58.